package org.feign.client;

import org.feign.autoconfiger.FeignConfiguration;
import org.feign.client.impl.UserFeignApiImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * @author liuxm
 * @version 1.0
 * @date 2021/3/23 18:01
 */
@Component
@FeignClient(name = "user-service",
        fallback = UserFeignApiImpl.class,
        configuration = FeignConfiguration.class)
public interface UserFeignApi {
    @GetMapping("/user/{username}")
    Map queyUserByName(@PathVariable("username") String username);
}
